package com.share.shrimpcolo;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Iterator;
import java.util.zip.GZIPOutputStream;

public class TestDemo {
	public static void main(String[] args) {

		// A
		// FileInputStream in;
		// try {
		// in = new FileInputStream("file.dat");
		// in.skip(9);
		// int c = in.read();
		// System.out.println((char)c);
		// } catch (FileNotFoundException e) {
		// e.printStackTrace();
		// } catch (IOException e) {
		// e.printStackTrace();
		// }

		// FileInputStream in;
		//
		// try {
		// in = new FileInputStream("file.dat");
		// byte[] b = new byte[80];
		// int c=in.read(b,9,10);
		//
		// System.out.println(c);
		// } catch (FileNotFoundException e) {
		// e.printStackTrace();
		// } catch (IOException e) {
		// e.printStackTrace();
		// }

		// Q12 A
		try {
			new BufferedWriter(new FileWriter("a.txt"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// Q12-B
		// new BufferedReader(new FileInputStream("a.dat"));

		// Q12-C
		try {
			new GZIPOutputStream(new FileOutputStream("a.zip"));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// Q12-D
		try {
			new ObjectInputStream(new FileInputStream("a.dat"));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// Q13
		// String s="hello world";
		// char c = s;
		
		


	}
}